/*
 * Copyright Notice ====================================================
 * This file contains proprietary information of JeeStrap Co.
 * Copying or reproduction without prior written approval is prohibited.
 * Copyright (c) 2014 All rights reserved. =============================
 */

package com.jeestrap.common.smartcoder.domain;

public class OrmTableField {
	private Boolean choosed = Boolean.TRUE;

	private String fieldName;

	private String fieldLabel;

	private String fieldType;

	private Boolean primaryKey = Boolean.FALSE;

	private Boolean allowNull = Boolean.FALSE;

	private Integer maxLength;

	private String javaFieldName;

	private String javaFieldType;

	private String pageDataType = "";

	private Boolean jspQueryField = Boolean.FALSE;

	private Boolean jspQueryListField = Boolean.TRUE;

	private Boolean jspEditField = Boolean.TRUE;

	private String jspFieldEditType = "text";

	private String jspComboxDataId = "";

	private String[] propertyNames = {"choosed", "fieldName", "fieldLabel", "fieldType", "primaryKey", "allowNull",
										"maxLength", "javaFieldName", "javaMapClass", "jspQueryField",
										"jspQueryListField", "jspEditField", "jspEditDataType", "jspFieldEditType",
										"jspComboxDataId"};

	public String[] getPropertyNames() {
		return this.propertyNames;
	}

	public Object getPropertyValue(String paramString) {
		if (paramString.equalsIgnoreCase("choosed"))
			return this.choosed;
		if (paramString.equalsIgnoreCase("fieldName"))
			return this.fieldName;
		if (paramString.equalsIgnoreCase("fieldLabel"))
			return this.fieldLabel;
		if (paramString.equalsIgnoreCase("fieldType"))
			return this.fieldType;
		if (paramString.equalsIgnoreCase("primaryKey"))
			return this.primaryKey;
		if (paramString.equalsIgnoreCase("allowNull"))
			return this.allowNull;
		if (paramString.equalsIgnoreCase("maxLength"))
			return this.maxLength;
		if (paramString.equalsIgnoreCase("javaFieldName"))
			return this.javaFieldName;
		if (paramString.equalsIgnoreCase("javaMapClass"))
			return this.javaFieldType;
		if (paramString.equalsIgnoreCase("jspEditDataType"))
			return this.pageDataType;
		if (paramString.equalsIgnoreCase("jspQueryField"))
			return this.jspQueryField;
		if (paramString.equalsIgnoreCase("jspQueryListField"))
			return this.jspQueryListField;
		if (paramString.equalsIgnoreCase("jspEditField"))
			return this.jspEditField;
		if (paramString.equalsIgnoreCase("jspFieldEditType"))
			return this.jspFieldEditType;
		if (paramString.equalsIgnoreCase("jspComboxDataId"))
			return this.jspComboxDataId;
		return null;
	}

	public void setPropertyValue(String paramString, Object paramObject) {
		if (paramString.equalsIgnoreCase("choosed")) {
			this.choosed = ((Boolean)paramObject);
		} else if (paramString.equalsIgnoreCase("fieldName")) {
			this.fieldName = ((String)paramObject);
		} else if (paramString.equalsIgnoreCase("fieldLabel")) {
			this.fieldLabel = ((String)paramObject);
		} else if (paramString.equalsIgnoreCase("fieldType")) {
			this.fieldType = ((String)paramObject);
		} else if (paramString.equalsIgnoreCase("primaryKey")) {
			this.primaryKey = ((Boolean)paramObject);
			if (Boolean.TRUE.equals(this.primaryKey))
				this.allowNull = Boolean.FALSE;
		} else if (paramString.equalsIgnoreCase("allowNull")) {
			if ((Boolean.FALSE.equals(this.primaryKey)) || (this.primaryKey == null))
				this.allowNull = ((Boolean)paramObject);
			if (Boolean.TRUE.equals(this.allowNull))
				this.jspQueryListField = Boolean.TRUE;
		} else if (paramString.equalsIgnoreCase("maxLength")) {
			this.maxLength = ((Integer)paramObject);
		} else if (paramString.equalsIgnoreCase("javaFieldName")) {
			this.javaFieldName = ((String)paramObject);
		} else if (paramString.equalsIgnoreCase("javaMapClass")) {
			this.javaFieldType = ((String)paramObject);
		} else if (paramString.equalsIgnoreCase("jspEditDataType")) {
			if (this.jspEditField.booleanValue())
				this.pageDataType = ((String)paramObject);
		} else if (paramString.equalsIgnoreCase("jspQueryField")) {
			this.jspQueryField = ((Boolean)paramObject);
		} else if (paramString.equalsIgnoreCase("jspQueryListField")) {
			this.jspQueryListField = ((Boolean)paramObject);
		} else if (paramString.equalsIgnoreCase("jspEditField")) {
			this.jspEditField = ((Boolean)paramObject);
			if (!this.jspEditField.booleanValue())
				this.pageDataType = "";
		} else if (paramString.equalsIgnoreCase("jspFieldEditType")) {
			this.jspFieldEditType = ((String)paramObject);
			if ("Text".equals(this.jspFieldEditType))
				this.jspComboxDataId = "";
		} else if (paramString.equalsIgnoreCase("jspComboxDataId")) {
			if ("Text".equals(this.jspFieldEditType))
				this.jspComboxDataId = "";
			else
				this.jspComboxDataId = ((String)paramObject);
		}
	}

	public void setFieldName(String paramString) {
		this.fieldName = paramString;
		this.javaFieldName = paramString;
	}

	public Boolean getAllowNull() {
		return this.allowNull;
	}

	public void setAllowNull(Boolean paramBoolean) {
		if ((Boolean.FALSE.equals(this.primaryKey)) || (this.primaryKey == null))
			this.allowNull = paramBoolean;
	}

	public Boolean getChoosed() {
		return this.choosed;
	}

	public void setChoosed(Boolean paramBoolean) {
		this.choosed = paramBoolean;
	}

	public String getFieldLabel() {
		return this.fieldLabel;
	}

	public void setFieldLabel(String paramString) {
		this.fieldLabel = paramString;
	}

	public String getFieldName() {
		return this.fieldName;
	}

	public String getFieldType() {
		return this.fieldType;
	}

	public void setFieldType(String paramString) {
		this.fieldType = paramString;
	}

	public String getJavaFieldName() {
		return this.javaFieldName;
	}

	public void setJavaFieldName(String paramString) {
		this.javaFieldName = paramString;
	}

	public String getJavaFieldType() {
		return this.javaFieldType;
	}

	public void setJavaFieldType(String paramString) {
		this.javaFieldType = paramString;
	}

	public String getPageDataType() {
		return this.pageDataType;
	}

	public void setPageDataType(String paramString) {
		this.pageDataType = paramString;
	}

	public String getJspComboxDataId() {
		return this.jspComboxDataId;
	}

	public void setJspComboxDataId(String paramString) {
		this.jspComboxDataId = paramString;
	}

	public Boolean getJspEditField() {
		return this.jspEditField;
	}

	public void setJspEditField(Boolean paramBoolean) {
		this.jspEditField = paramBoolean;
	}

	public String getJspFieldEditType() {
		return this.jspFieldEditType;
	}

	public void setJspFieldEditType(String paramString) {
		this.jspFieldEditType = paramString;
	}

	public Boolean getJspQueryField() {
		return this.jspQueryField;
	}

	public void setJspQueryField(Boolean paramBoolean) {
		this.jspQueryField = paramBoolean;
	}

	public Integer getMaxLength() {
		return this.maxLength;
	}

	public void setMaxLength(Integer paramInteger) {
		this.maxLength = paramInteger;
	}

	public Boolean getPrimaryKey() {
		return this.primaryKey;
	}

	public void setPrimaryKey(Boolean paramBoolean) {
		this.primaryKey = paramBoolean;
		if (Boolean.TRUE.equals(this.primaryKey))
			this.allowNull = Boolean.FALSE;
	}

	public void setPropertyNames(String[] paramArrayOfString) {
		this.propertyNames = paramArrayOfString;
	}

	public Boolean getJspQueryListField() {
		return this.jspQueryListField;
	}

	public void setJspQueryListField(Boolean paramBoolean) {
		this.jspQueryListField = paramBoolean;
	}
}
